package com.example.client.controller;

import com.example.client.message.StreamIO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/message")
public class MessageController {
    @Autowired
    private StreamIO streamIO;


    @RequestMapping("/send")
    public void send() {
        String message = " " + new Date();
        streamIO.out().send(MessageBuilder.withPayload(message).build());
    }
}
